import shutil
import os
f1=open("demo.txt",'r')
#代码开始
author = input("")
lauthor = ""
lines = f1.readlines()
for line in lines:
    if len(line.split("　")) == 2:
        lauthor = line.split("　")[1].strip("\n")
        # print(lauthor)
    if lauthor == author:
        print(line, end="")
    f2 = open("{}.txt".format(lauthor), "a+")
    f2.writelines(line)
#代码结束
f1.close()
f2.close()